import { Button } from "antd"
import { useNavigate } from "react-router-dom"
import { useDispatch } from "react-redux"
import { loginOut } from '@/store/modules/userStore'

const CodeBlockPage: React.FC = () => {
    const Nav = useNavigate()
    const dispatch: AppDispatch = useDispatch()
    const loginOutHandle = async () => {
        await dispatch(loginOut())
        Nav('/login')
    }
    return (<>
        <h1>ceshi </h1>
        <Button onClick={loginOutHandle}>退出登录</Button>
    </>)
}
export default CodeBlockPage